package com.kgc.service.impl;

import com.kgc.dao.NewsDao;
import com.kgc.dao.impl.NewsDaoImpl;
import com.kgc.entity.News;
import com.kgc.service.NewsService;
import com.kgc.util.PageSupport;

import java.util.List;

/**
 * <h3>项目名称:demo03050</h3>
 * <p>本API描述:新闻业务处理实现类</p>
 * <p>@author : AliyZhang</p>
 * <p>@date : 2021-03-05 19:37</p>
 **/
public class NewsServiceImpl implements NewsService {
    private NewsDao newsDao=new NewsDaoImpl();

    @Override
    public int addNews(News news) {
        return newsDao.addNews(news);
    }

    @Override
    public int deleteNewsById(int id) {
        return newsDao.deleteNewsById(id);
    }

    @Override
    public int updateNews(News news) {
        return newsDao.updateNews(news);
    }

    @Override
    public List<News> queryNewsAll() {
        return newsDao.queryNewsAll();
    }

    @Override
    public News queryNewsById(int id) {
        return newsDao.queryNewsById(id);
    }

    @Override
    public void queryPageNews(PageSupport<News> page) {
        newsDao.queryPageNews(page);
    }
}
